﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace QiAdmin.Core.Utils
{
    public class ControllerUtil
    {
        public static List<string> GetAllControllerNames(Assembly assembly)
        {
            var types = assembly.GetTypes();
            var controllerNames = types.Where(t => t.IsClass && t.BaseType == typeof(ControllerBase))
                .Select(t => t.Name.Replace("Controller", ""))
                .ToList();
            return controllerNames;
        }
    }
}
